<template>
  <div class="test-page">
    <!-- <el-button type="text" @click="dialogFormVisible = true">打开嵌套表单的 Dialog</el-button>

    <el-dialog title="拉黑客户" :visible.sync="dialogFormVisible" width="550px">
      <lahei></lahei>
    </el-dialog>
    <basesz></basesz> -->
    <!-- <my-textarea width="299" rows="1"></my-textarea> -->
    <!-- <shujuzonglan></shujuzonglan> -->
    <!-- <echarts></echarts> -->
    <!-- <tongji-card title="总会话量" data="60%" tip="有效会话数200"></tongji-card> -->
    <!-- <gongdan-more-info></gongdan-more-info> -->
    <el-button type="text" @click="dialogVisible = true"
      >点击打开 Dialog</el-button
    >
    <my-dialog :show="true" title="新建工单" width="600" success="创建工单成功">
      <!-- <build></build> -->
      <my-form :myform="form" :myrules="rules" @value="updata"></my-form>
    </my-dialog>
    <my-input ph="adsfsd"></my-input>
  </div>
</template>

<script>
// import Lahei from '@/components/Session/Lahei'
// import Basesz from '@/components/Setting/Gongdan/Basesz'
// import MyTextarea from '@/components/MyInput/MyTextarea'
// import shujuzonglan from '@/components/DataGraphs/shujuzonglan'
// import Echarts from '@/components/DataGraphs/Echarts'
// import TongjiCard from '@/components/TongjiCard'
// import GongdanMoreInfo from '@/components/Gongdan/GongdanMoreInfo'
// import build from '@/components/temp/build'
import MyDialog from "@/components/MyInput/MyDialog";
import MyInput from "@/components/MyInput/MyInput";
import MyForm from "@/components/MyInput/MyForm";
export default {
  components: {
    // Lahei,
    // Basesz
    // MyTextarea,
    // shujuzonglan,
    // Echarts,
    // TongjiCard,
    // GongdanMoreInfo
    // build,
    MyDialog,
    MyInput,
    MyForm,
  },
  created() {},
  data() {
    return {
      dialogFormVisible: false,
      form: {
        name: "顶顶顶顶",
        msg: "",
        city: "",
        school: '',
        f: {
          f1: {
            label: "活动名称",
            type: "input",
            prop: "name",
            setting: {
              ph: "请输入姓名",
              value: '低调点'
            },
          },
          f2: {
            label: "活动信息",
            type: "textarea",
            prop: "msg",
            setting: {
              ph: "请输入信息",
              rows: "10",
            },
          },
          f3: {
            label: "城市",
            type: "select",
            prop: "city",
            setting: {
              ph: "选择城市",
              items: [
                {
                  label: "北京",
                  value: 0,
                },
                {
                  label: "上海",
                  value: 1,
                },
              ],
            },
          },
          f4:{
            label:'学校',
            type: 'select',
            prop: 'school',
            setting: {
              ph: '选择学校',
              items: [
                {
                  label:'淮师大',
                  value:0
                }
              ]
            }
          }
        },
      },
      rules: {
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        msg: [{ required: true, message: "请选择活动区域", trigger: "change" }],
        city: [
          { required: true, message: "请选择一个城市", trigger: "change" },
        ],
        school: [
          {
            required:false, message: "请选择一个学校", trigger: "change" 
          }
        ]
      },
    };
  },
  methods: {
    updata(obj) {
      console.log("obj");
      console.log(obj);
      this.form[obj.propname] = obj.valuename;
    },
  },
};
</script>

<style>
.test-page {
  width: 100%;
  /* height: 80%; */
  padding: 50px;
  border: 5px dashed pink;
  display: flex;
  flex-wrap: wrap;
}
</style>